﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Wix.Aura.Common.CustomTypes;
using Wix.Aura.Common;

namespace Wix.Aura.UnitTests.Common {
	[TestFixture]
	public class IniFileSearchSerialization : ComplianceCheckChildren {
		[Test]
		public void IniFileSearchIdParameter() {
			string expected = string.Format(baseXml, @"<IniFileSearch Id=""id"" Key=""Key"" Name=""longFileName"" Section=""section"" />");
			check.IniFileSearch.Add(new IniFileSearch("id", "Key", new LongFileNameType("longFileName"), "section"));
			Assertion(expected, project);
		}

		[Test]
		public void AllAttributes() {
			string expected = string.Format(baseXml, @"<IniFileSearch Id=""id"" Field=""9"" Key=""Key"" LongName=""longerName"" Name=""longFileName"" Section=""section"" ShortName=""shortName"" Type=""raw"" />");
			check.IniFileSearch.Add(new IniFileSearch("id", "Key", new LongFileNameType("longFileName"), "section") { Field = 9, LongName = new LongFileNameType("longerName"), ShortName = new ShortFileNameType("shortName"), FileType = FileType.Raw });
			Assertion(expected, project);
		}
	}
}
